package com.dm.learn.threads.threadpool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class TaskTest {
    public static void main(String[] args) {
        // 核心线程为3的线程池,最大线程为3的线程池，线程池中只会有三个线程
        ExecutorService executorService = Executors.newFixedThreadPool(3);
        for (int i = 0; i < 5; i++) {
            executorService.execute(new Task());
        }
    }
}
